<script type='text/javascript'>
function confirma(id, nome)
{
    if (confirm("Tem certeza que deseja excluir o plano " + nome + "?"))
    {
        location.href="plano/excluir/"+id;
    }
    else
    {
        return false;
    }
    
}
</script>
<div class="wrapper">
    <br><br>
    <div class="clear"></div>
    <div class="leadsCtn">
        <div class="title">
            <h4 class="left">Planos</h4>
            <div class="right" style="vertical-align: middle; margin-right: 10px; margin-top: 10px">
                 <?php echo $html->link('Criar novo plano', '/plano/adicionar', array( 'class' => 'botaoCinza right peq' )); ?>
            </div>
        </div>
        <div class="content">
            <div class="clear"></div>
            <table>
                <thead>
                    <th width="655px">Plano</th>
                    <th width="80px" style="text-align:center;">Clientes</th>
                    <th width="180px" colspan="2">&nbsp;</th>
                </thead>
                <tbody>
                <?php
                    foreach($arrPlano as $objPlano)
                    {
                            $objPlano = (object) $objPlano;
                ?>
                    <tr>
                        <td><?php echo $objPlano->plan_nome." de valor R$".$objPlano->plan_valor.",00 - ".$objPlano->plan_usuarios." usuários, ".$objPlano->plan_leads." leads e ".$objPlano->plan_campanhas." formulários."; ?></td>
                        <td align="center"><?php echo $objPlano->clie_count; ?></td>
                        <td><?php echo $html->link('Editar', '/plano/editar/'.$objPlano->plan_id, array( 'class' => 'editarIcon' )); ?></td>
                        <td>
                        <?php
                        if($objPlano->podeDeletar == true)
                        {
                           echo "<a border='0' class='deleteIcon' href='javascript:confirma(\"".$objPlano->plan_id."\",\"".$objPlano->plan_nome."\")' >Excluir</a>";
                        }
                        ?>
                        </td>
                    </tr>
                <?php 
                    }				
                ?>
                </tbody>
            </table>
        </div>
        <br><br>
        {GRAFICO}
    </div><!-- .leads -->
</div><!-- .wraper -->